package com.fernandomartines.dbcheck.graph.element;

import java.util.ArrayList;

public class ModelGraphEntities extends ArrayList<ModelGraphEntity> {

    public ModelGraphEntity getEntityById(String id) {
        for (ModelGraphEntity entity: this)
            if (entity.getId().equals(id))
                return entity;
        return null;
    }

    public ModelGraphEntity getEntityByName(String name) {
        for (ModelGraphEntity entity: this)
            if (entity.getName().equals(name))
                return entity;
        return null;
    }

}
